<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <style>
    body{
      perspective: 500px;
    }
    .box{
      position: relative;
      width: 200px;
      height: 200px;
      transition: all 1s;
      margin: 100px auto;
      transform-style: preserve-3d;
    }
    .xia,
    .shang{
      position: absolute;
      width: 100%;
      height: 100%;
      line-height: 200px;
      text-align: center;
      font-size: 20px;
      font-weight: 700;
      color: #FFFFFF;
    }
    .xia{
      background-color: purple;
      transform: translateY(100px) rotateX(-90deg) ;
    }
    .shang{
      background-color: pink;
      transform:translateZ(100px);
    }
    .box:hover{
      transform: rotateX(90deg);
    }
  </style>
</head>
<body>
<div class="box">
  <div class="shang">黑马</div>
  <div class="xia">我在等你</div>
</div>
</body>
</html>
